package com.yxkj.syh.app.huarong.data_center.model;

import com.syh.app.basic.utils.net.ApiObserver;
import com.yxkj.syh.app.huarong.util.RetrofitHelper;
import com.trello.rxlifecycle2.LifecycleTransformer;
import com.yxkj.syh.app.huarong.api.AliCityApi;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

/**
 * 创建者：SYH
 * 时间：2020/5/22 13:57
 * 编辑者：SYH、
 * 标签：
 * 补充说明：
 */
public class AliCityModel {
    private static AliCityModel accountModel;

    private AliCityModel() {
    }

    public static AliCityModel getAliCityModel() {
        if (accountModel == null) accountModel = new AliCityModel();
        return accountModel;
    }

    public void getAliCity(long pId, LifecycleTransformer transformer, ApiObserver apiObserver){
        RetrofitHelper.createApiWithAli(AliCityApi.class,"http://ali-city.showapi.com/").aliCity(pId).compose(transformer).subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread()).subscribe(apiObserver);
    }

}
